package com.myserver.core;

import java.io.IOException;
import java.net.MalformedURLException;

public  abstract class Servlet {
    public void service(Request request,Response response) throws IOException {
        if(request==null){
            return;
        }
        if (request.getMethod().equalsIgnoreCase("get")) {
            doGet(request, response);
        }else if(request.getMethod().equalsIgnoreCase("post")){
            doPost(request,response);
        }
    }
    public abstract void doGet(Request request, Response response) throws IOException;

    public abstract void doPost(Request request, Response response);
}
